﻿namespace LitTools
{
    public class Singleton<T> where T : Singleton<T>, new()
    {
        private static T _Instance;
        public static T Instance
        {
            get
            {
                if (_Instance != null)
                    return _Instance;
                else
                {
                    _Instance = new T();
                    _Instance.Init();
                    return _Instance;
                }
            }
        }

        public virtual void Init()
        {

        }
    }
}